package leetcodecompetition.S119;

/**
 * @Author: Siantar
 * @Date: 2023-12-09-22:36
 * @Description: 1.0
 */
public class T100152 {
    public int removeAlmostEqualCharacters(String word) {
        int res = 0;
        for (int i = 1; i < word.length(); i++) {
            if (Math.abs(word.charAt(i - 1) - word.charAt(i)) < 2) {
                res++;
                i++;
            }
        }
        return res;
    }

}
